<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8" />
    <title>java</title>
    <link rel="stylesheet" th:href="@{/css/style.css}" />
</head>
<body>
<div class="n-support">请使用Chrome、Safari等webkit内核的浏览器！</div>
<div class="n-head">
    <div class="g-doc f-cb">
        <div class="user" th:if="${session.user == null}">请<a th:href="@{/login}">[登录]</a></div>
        <div class="user" th:if="${session.user != null && session.user.userType == 1}">
            卖家你好，<span class="name" th:text="${session.user.username}"></span>！<a th:href="@{/logout}">[退出]</a>
        </div>
        <div class="user" th:if="${session.user != null && session.user.userType == 2}">
            买家你好，<span class="name" th:text="${session.user.username}"></span>！<a th:href="@{/logout}">[退出]</a>
        </div>
        <ul class="nav">
            <li><a th:href="@{/}">首页</a></li>
            <li th:if="${session.user != null && session.user.userType == 1}"><a th:href="@{/public}">发布</a></li>
            <li th:if="${session.user != null && session.user.userType == 2}"><a th:href="@{/account}">账务</a></li>
            <li th:if="${session.user != null && session.user.userType == 2}"><a th:href="@{/settleAccount}">购物车</a></li>
        </ul>
    </div>
</div>
<div class="g-doc">
    <div class="m-tab m-tab-fw m-tab-simple f-cb">
        <h2>已购买的内容</h2>
    </div>
    <table class="m-table m-table-row n-table g-b3">
        <colgroup><col class="img"/><col/><col class="time"/><col/><col class="num"/><col/><col class="price"/><col/></colgroup>
        <thead>
        <tr><th>内容图片</th><th>内容名称</th><th>购买时间</th><th>购买数量</th><th>购买价格</th></tr>
        </thead>
        <tbody>
        <tr th:each="commodity:${commodityList}">
            <td><a th:href="@{/show}+'?id='+${commodity.id}"><img th:src="${commodity.pic}"></a></td>
            <td style="text-align: left"><h4><a th:href="@{/show}+'?id='+${commodity.id}">[[${commodity.title}]]</a></h4></td>
            <td style="text-align: left"><span class="v-time" th:text="${#dates.format(commodity.buyDate,'yyyy-MM-dd HH:mm')}"></span></td>
            <td style="text-align: left"><span class="v-num">[[${commodity.count}]]</span></td>
            <td style="text-align: left"><span class="v-unit">¥</span><span class="value">[[${commodity.buyPrice}]]</span></td>
        </tr>
        </tbody>
        <tfoot>
        <tr>
            <td colspan="4"><div class="total">总计：</div></td>
            <td><span class="v-unit">¥</span><span class="value">[[${totalPrice}]]</span></td>
        </tr>
        </tfoot>
    </table>
</div>
<div class="n-foot">
    <p>
        版权所有：网易云课堂<a
            href="http://mooc.study.163.com/smartSpec/detail/85002.htm"
    >Java开发工程师(Web方向)</a
    >微专业团队
    </p>
</div>
</body>
</html>
